#ifndef CLASS_ASSETS_H
#define CLASS_ASSETS_H

/***
 * class-assets.h
 *
 * Header file for the asset handling code
 *
 * @author Leigh Ashton <gravious@gmail.com>
 * @since  15 September 2008
 **/
	
#include "SDL/SDL.h"
#include "SDL/SDL_opengl.h"

#include "math-code.h"
#include "class-engine.h"

#include <vector>
#include <string>

using namespace std;

extern float PI;

extern struct sMouse	*mouse;

extern class cEngine *engine;

	// Class Definitions

	class cAsset{

		public:

			// Public Member Fields
		
				string assetName;

				int width, height, depth, handleX, handleY, z;	// Asset Dimensions
			
				GLuint texture;
				SDL_Surface *surface;

			// Public Member Functions

				cAsset();
				~cAsset();

				void loadAsset(string filename);

		private:

			// Private Member Functions

				void makeTextureFromSurface(); // TODO
	};

	class cEntity{

		public:

			// Member Structs

			// Quad corner co-ords
			struct sTopLeft     { float x, y, angle, velocity; } topLeft;
			struct sTopRight    { float x, y, angle, velocity; } topRight;
			struct sBottomRight { float x, y, angle, velocity; } bottomRight;
			struct sBottomLeft  { float x, y, angle, velocity; } bottomLeft;

			struct sPolarVector {
				float angle, velocity;
			};

			// Public Member Fields

			int x, y, h, z, timestamp, pixelsPerSecond;
			float angle;

			sPolarVector movementVector;	// A Polar vector indicating current entity direction and speed

			// Public Member Functions

			cEntity();
			void logic();
			void render();
			void trackMouse(sMouse &mouse);	// Make a vector for following the mouse from the entity position
	};

	class cAnimation{

		/*
		cAnimation will reference cAsset to create
		blocks of sprites as animations and hold
		data on how their timing is set.
		*/

	};

	// External Data

	extern vector<cAsset*>		assets;
	extern vector<cAnimation*>	animations;

#endif // CLASS_ASSETS_H